package com.easy.common.util.file;
import java.io.File;
import java.io.FileFilter;
import java.util.Date;

public class TimeFileFilter
	implements FileFilter
{
	private Date cpTime;
	private boolean acceptNew;

	public TimeFileFilter(Date cpTime, boolean acceptNew)
	{
		this.cpTime = null;
		this.acceptNew = true;
		this.cpTime = cpTime;
		this.acceptNew = acceptNew;
	}

	public boolean accept(File file)
	{
		if (acceptNew)
			return file.lastModified() > cpTime.getTime();
		return file.lastModified() <= cpTime.getTime();
	}

}
